import React from 'react'
import { useRef } from 'react'
import { Swiper } from 'antd-mobile'
import { SwiperRef } from 'antd-mobile/es/components/swiper'
type Props = {
    swiperArr: Array<{ img: string }>
}

export default function Myswiper({ swiperArr }: Props) {
    const ref = useRef<SwiperRef>(null)
    const colors = ['#ace0ff', '#bcffbd', '#e4fabd', '#ffcfac']
    const items = swiperArr.map((item, index) => (
        <Swiper.Item key={index} >
            <div>
                <img style={{ width: '100%' }} src={item.img} alt="" />
            </div>

        </Swiper.Item>
    ))
    return (
        <Swiper autoplay>{items}</Swiper>
    )
}